package com.smedi.ismedi.dangeroussourcemanage.core.domain.repository;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smedi.ismedi.dangeroussourcemanage.api.dto.request.DangerSourceListRequest;
import com.smedi.ismedi.dangeroussourcemanage.api.dto.request.DangerSourceTimeLineRequest;
import com.smedi.ismedi.dangeroussourcemanage.core.domain.aggregatemodel.*;
import com.smedi.ismedi.dangeroussourcemanage.core.domain.aggregatemodel.QueryDangerousSourceManagePageList;
import com.smedi.ismedi.dangeroussourcemanage.core.port.adapter.persistence.model.DangerousSourceLibraryEntity;
import com.smedi.ismedi.dangeroussourcemanage.core.port.adapter.persistence.model.DangerousSourceManageEntity;

import java.util.List;
import java.util.Map;

/**
 * 危险源基础仓库
 *
 * @author xienannan
 * @date 2021/08/23
 */
public interface DangerousSourceManageRepository {
    /**
     * 根据id获取危险源详情
     *
     * @param dangerousSourceId 危险源id
     * @return DangerousSourceManageBasic
     */
    DangerousSourceManage doSelectById(Long dangerousSourceId);


    /**
     * 危险源分页查询
     *
     * @param queryDangerousSourceManagePageList
     * @return Page<DangerousSourceManage>
     */
    Page<DangerousSourceManage> selectDangerousSourcePageList(QueryDangerousSourceManagePageList queryDangerousSourceManagePageList);

    /**
     * 危险源列表查询
     *
     * @param queryDangerousSourceList
     * @return Page<DangerousSourceManage>
     */
    List<DangerousSourceManage> selectDangerousSourceList(QueryDangerousSourceList queryDangerousSourceList);

    /**
     * 通过id查询危险源
     *
     * @param dangerousSourceManageIds
     * @return List<DangerousSourceManage>
     */
    List<DangerousSourceManage> selectDangerousSourceListByDangerousIds(List<Long> dangerousSourceManageIds);

    /**
     * 危险源分页查询移动端
     *
     * @param queryDangerousSourceManageList
     * @return Page<DangerousSourceManage>
     */
    Page<DangerousSourceManage> selectMobileDangerousSourceList(MobileQueryDangerousSourceManageList queryDangerousSourceManageList);

    List<DangerousSourceManageEntity> getProjectWithDangerSourceList(DangerSourceListRequest dangerSourceListRequest);

    Integer getProjectWithDangerSourceCount(DangerSourceListRequest dangerSourceListRequest);

    Integer getDangerSourceCountByTimeLine(TimeLine timeLine);
}
